function _extends() {
  _extends = Object.assign
    ? Object.assign.bind()
    : function (target) {
        for (var i = 1; i < arguments.length; i++) {
          var source = arguments[i];
          for (var key in source) {
            if (Object.prototype.hasOwnProperty.call(source, key)) {
              target[key] = source[key];
            }
          }
        }
        return target;
      };
  return _extends.apply(this, arguments);
}
import { omit } from '@szzj/utils';
import { Radio } from 'antd';
import 'antd/es/radio/style/index.js';
import React from 'react';
import createField from '../../createField';

/**
 * 单个单选框
 */
export default createField(Radio, {
  defaultDetailComponent: function defaultDetailComponent(props) {
    // @todo Field 需要过滤 valuePropName，FieldDetail 通过 context 获取
    var rest = omit(props, 'valuePropName');
    return /*#__PURE__*/ React.createElement(
      Radio,
      _extends({}, rest, {
        onChange: undefined,
      }),
    );
  },
  defaultFormItemProps: {
    valuePropName: 'checked',
    // @ts-ignore
    getValueFromEvent: function getValueFromEvent(event) {
      return event.target.checked;
    },
  },
});
